package fr.aquariophilie.org;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

public class includefunc {

	
	public void addPreference(Activity activity,String namespace,String name,String value){
		  SharedPreferences prefs = activity.getSharedPreferences(namespace, Context.MODE_PRIVATE);
		  SharedPreferences.Editor editor = prefs.edit();
		  editor.putString(name, value);
		  editor.commit();
		}

	public String getPreference(Activity activity,String namespace,String name){
		  SharedPreferences prefs = activity.getSharedPreferences(namespace,Context.MODE_PRIVATE);
		  return prefs.getString(name, "");  
		}

	public void removePreference(Activity activity,String namespace,String name){
		  SharedPreferences prefs = activity.getSharedPreferences(namespace,Context.MODE_PRIVATE);
		  SharedPreferences.Editor editor = prefs.edit();
		  editor.remove(name);
		  editor.commit();  
		}
}
